package com.nts.visionworks.business.schedule.domain;

// Generated 2013. 6. 23 ���� 6:33:40 by Hibernate Tools 4.0.0

import com.nts.visionworks.business.application.domain.ServiceChannel;
import java.util.Date;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.validation.constraints.Max;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

import org.hibernate.validator.constraints.Range;

/**
 * Schedule generated by hbm2java
 */
@Entity
@Table(name = "schedule", catalog = "visionworks")
public class Schedule implements java.io.Serializable
{

	private Long scheduleId;
	private String scheduleName;
	private short scheduleType;
	private short state;
	private Date startDate;
	private Date endDate;
	private Date startTime;
	private Date endTime;
	private String workdays;
	private String description;
	private Date createdDateTime;
	private Long creatorId;
	private Date updatedDateTime;
	private Set<ScheduleEndPointPower> scheduleEndPointPowers = new HashSet<ScheduleEndPointPower>(
			0);
	private Set<ScheduleOperationTrace> scheduleOperationTraces = new HashSet<ScheduleOperationTrace>(
			0);
	private Set<ScheduleContentsStage> scheduleContentsStages = new HashSet<ScheduleContentsStage>(
			0);
	private Set<ServiceChannel> serviceChannels = new HashSet<ServiceChannel>(0);

	public Schedule()
	{
	}

	public Schedule(String scheduleName, short scheduleType, short state,
			Date createdDateTime)
	{
		this.scheduleName = scheduleName;
		this.scheduleType = scheduleType;
		this.state = state;
		this.createdDateTime = createdDateTime;
	}

	public Schedule(String scheduleName, short scheduleType, short state,
			Date startDate, Date endDate, Date startTime, Date endTime,
			String workdays, String description, Date createdDateTime,
			Long creatorId, Date updatedDateTime,
			Set<ScheduleEndPointPower> scheduleEndPointPowers,
			Set<ScheduleOperationTrace> scheduleOperationTraces,
			Set<ScheduleContentsStage> scheduleContentsStages,
			Set<ServiceChannel> serviceChannels)
	{
		this.scheduleName = scheduleName;
		this.scheduleType = scheduleType;
		this.state = state;
		this.startDate = startDate;
		this.endDate = endDate;
		this.startTime = startTime;
		this.endTime = endTime;
		this.workdays = workdays;
		this.description = description;
		this.createdDateTime = createdDateTime;
		this.creatorId = creatorId;
		this.updatedDateTime = updatedDateTime;
		this.scheduleEndPointPowers = scheduleEndPointPowers;
		this.scheduleOperationTraces = scheduleOperationTraces;
		this.scheduleContentsStages = scheduleContentsStages;
		this.serviceChannels = serviceChannels;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "ScheduleId", unique = true, nullable = false)
	public Long getScheduleId()
	{
		return this.scheduleId;
	}

	public void setScheduleId(Long scheduleId)
	{
		this.scheduleId = scheduleId;
	}

	@NotNull(message = "validation.schedule.scheduleName.notNull")
	@Size(message = "validation.schedule.scheduleName.length", max = 100, min = 1)
	@Column(name = "ScheduleName", nullable = false, length = 100)
	public String getScheduleName()
	{
		return this.scheduleName;
	}

	public void setScheduleName(String scheduleName)
	{
		this.scheduleName = scheduleName;
	}

	@Range(message = "validation.schedule.scheduleType.range", max = 1, min = 0)
	@Column(name = "ScheduleType", nullable = false)
	public short getScheduleType()
	{
		return this.scheduleType;
	}

	public void setScheduleType(short scheduleType)
	{
		this.scheduleType = scheduleType;
	}

	@NotNull(message = "validation.schedule.state.notNull")
	@Column(name = "State", nullable = false)
	public short getState()
	{
		return this.state;
	}

	public void setState(short state)
	{
		this.state = state;
	}

	@Temporal(TemporalType.DATE)
	@Column(name = "StartDate", length = 10)
	public Date getStartDate()
	{
		return this.startDate;
	}

	public void setStartDate(Date startDate)
	{
		this.startDate = startDate;
	}

	@Temporal(TemporalType.DATE)
	@Column(name = "EndDate", length = 10)
	public Date getEndDate()
	{
		return this.endDate;
	}

	public void setEndDate(Date endDate)
	{
		this.endDate = endDate;
	}

	@Temporal(TemporalType.TIME)
	@Column(name = "StartTime", length = 8)
	public Date getStartTime()
	{
		return this.startTime;
	}

	public void setStartTime(Date startTime)
	{
		this.startTime = startTime;
	}

	@Temporal(TemporalType.TIME)
	@Column(name = "EndTime", length = 8)
	public Date getEndTime()
	{
		return this.endTime;
	}

	public void setEndTime(Date endTime)
	{
		this.endTime = endTime;
	}

	@Max(message = "validation.schedule.workdays.max", value = 7)
	@Column(name = "Workdays", length = 7)
	public String getWorkdays()
	{
		return this.workdays;
	}

	public void setWorkdays(String workdays)
	{
		this.workdays = workdays;
	}

	@Max(message = "validation.schedule.description.max", value = 1000)
	@Column(name = "Description", length = 1000)
	public String getDescription()
	{
		return this.description;
	}

	public void setDescription(String description)
	{
		this.description = description;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "CreatedDateTime", nullable = false, length = 19)
	public Date getCreatedDateTime()
	{
		return this.createdDateTime;
	}

	public void setCreatedDateTime(Date createdDateTime)
	{
		this.createdDateTime = createdDateTime;
	}

	@Column(name = "CreatorId")
	public Long getCreatorId()
	{
		return this.creatorId;
	}

	public void setCreatorId(Long creatorId)
	{
		this.creatorId = creatorId;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "UpdatedDateTime", length = 19)
	public Date getUpdatedDateTime()
	{
		return this.updatedDateTime;
	}

	public void setUpdatedDateTime(Date updatedDateTime)
	{
		this.updatedDateTime = updatedDateTime;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "schedule")
	public Set<ScheduleEndPointPower> getScheduleEndPointPowers()
	{
		return this.scheduleEndPointPowers;
	}

	public void setScheduleEndPointPowers(
			Set<ScheduleEndPointPower> scheduleEndPointPowers)
	{
		this.scheduleEndPointPowers = scheduleEndPointPowers;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "schedule")
	public Set<ScheduleOperationTrace> getScheduleOperationTraces()
	{
		return this.scheduleOperationTraces;
	}

	public void setScheduleOperationTraces(
			Set<ScheduleOperationTrace> scheduleOperationTraces)
	{
		this.scheduleOperationTraces = scheduleOperationTraces;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "schedule")
	public Set<ScheduleContentsStage> getScheduleContentsStages()
	{
		return this.scheduleContentsStages;
	}

	public void setScheduleContentsStages(
			Set<ScheduleContentsStage> scheduleContentsStages)
	{
		this.scheduleContentsStages = scheduleContentsStages;
	}

	@ManyToMany(fetch = FetchType.LAZY)
	@JoinTable(name = "service_channel_schedule", catalog = "visionworks", joinColumns =
	{ @JoinColumn(name = "ScheduleId", nullable = false, updatable = false) }, inverseJoinColumns =
	{ @JoinColumn(name = "ChannelId", nullable = false, updatable = false) })
	public Set<ServiceChannel> getServiceChannels()
	{
		return this.serviceChannels;
	}

	public void setServiceChannels(Set<ServiceChannel> serviceChannels)
	{
		this.serviceChannels = serviceChannels;
	}

}
